﻿using System;
using System.CodeDom;

namespace Wicresoft.EKA.NRemedy.CodeGenerate
{
    /// <summary>
    /// 现在只有一种Field,所以不需要工厂模式。
    /// </summary>
    public static class GenerateField
    {

        public static void Create(CodeTypeDeclaration classType, string fieldName, string fieldType, string propertyName)
        {
            if (classType == null) throw new ArgumentNullException("classType");
            if (string.IsNullOrEmpty(fieldName)) throw new ArgumentNullException("fieldName");
            if (string.IsNullOrEmpty(fieldType)) throw new ArgumentNullException("fieldType");

            CodeMemberField _field = new CodeMemberField();
            _field.Name = fieldName;
            _field.Type = new CodeTypeReference(fieldType);
            _field.Attributes = MemberAttributes.Public | MemberAttributes.Static | MemberAttributes.Abstract;

            CodeMemberField _field = new CodeMemberField();
            _field.Name = fieldName;
            _field.Type = new CodeTypeReference(fieldType);
            _field.Attributes = MemberAttributes.Public | MemberAttributes.Static | MemberAttributes.Abstract;

            classType.Members.Add(_field);

        }


        internal static void CreateID(CodeTypeDeclaration codeTypeDeclaration, string p1, string p2, string p3)
        {
            throw new NotImplementedException();
        }
    }
}
